<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <title>添加小知识</title>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <meta name="renderer" content="webkit"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/png" href="assets/common/i/favicon.ico"/>
    <meta name="apple-mobile-web-app-title" content="添加小知识"/>
    <link rel="stylesheet" href="Css/amazeui.min.css"/>
    <link rel="stylesheet" href="Css/app.css"/>
    <link rel="stylesheet" href="Css/font_783249_3hfdb7m5w0j.css">
    <script src="Scripts/jquery.min.js"></script>
    <script src="Scripts/font_783249_e5yrsf08rap.js"></script>
    <script>
        BASE_URL = 'https://demo.yiovo.com/';
        STORE_URL = 'index.php?s=/store';
    </script>
</head>

<body data-type="">
<div class="am-g tpl-g">
    <!-- 内容区域 start -->
    <div class="tpl-content-wrapper ">
        <link href="assets/store/css/goods.css?v=1.1.15" rel="stylesheet">
        <link href="assets/common/plugins/umeditor/themes/default/css/umeditor.css" rel="stylesheet">
        <div class="row-content am-cf">
            <div class="row">
                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                    <div class="widget am-cf">
                        <form class="am-form tpl-form-line-form" id="my-form" method="post" novalidate="novalidate">
                            <div class="widget-body">
                                <fieldset>
                                    <div class="widget-head am-cf">
                                        <div id="title" class="widget-title am-fl">添加用户</div>
                                    </div>
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">用户名： </label>
                                        <div class="am-u-sm-9 am-u-end">
                                            <input name="goods[goods_name]" class="tpl-form-input" id = "username" required="required" type="text" value="">
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">密码：</label>
                                        <div class="am-u-sm-9 am-u-end">
                                            <input name="goods[goods_name]" class="tpl-form-input" id = "password" required="required" type="password" value="">
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-u-lg-2 am-form-label ">昵称： </label>
                                        <div class="am-u-sm-9 am-u-end">
                                            <input name="goods[goods_name]" class="tpl-form-input" id = "nickname"required="" type="text" value="">
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-u-lg-2 am-form-label ">手机： </label>
                                        <div class="am-u-sm-9 am-u-end">
                                            <input name="goods[goods_name]" class="tpl-form-input" id = "phone" required="" type="text" value="">
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-u-lg-2 am-form-label ">邮箱：</label>
                                        <div class="am-u-sm-9 am-u-end">
                                            <input name="goods[goods_name]" class="tpl-form-input" id = "email"required="" type="text" value="">
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-u-lg-2 am-form-label ">QQ： </label>
                                        <div class="am-u-sm-9 am-u-end">
                                            <input name="goods[goods_name]" class="tpl-form-input" id = "qq"required="" type="text" value="">
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-u-lg-2 am-form-label ">识别码： </label>
                                        <div class="am-u-sm-9 am-u-end">
                                            <input name="goods[goods_name]" class="tpl-form-input" readonly id = "qq"required="" type="text" value="">
                                        </div>
                                    </div>

                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-u-lg-2 am-form-label ">最小进货额度： </label>
                                        <div class="am-u-sm-9 am-u-end">
                                            <input name="goods[goods_name]" class="tpl-form-input" id = "qq"required="" type="text" value="">
                                        </div>
                                    </div>

                                    <div class="am-form-group">
                                        <div class="tpl-table-black-operation">

                                            <a href="javascript:;" class="item-submit tpl-table-black-operation-del"
                                               data-id="10011">
                                                提交
                                            </a>
                                        </div>
                                    </div>
                                </fieldset>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <script>
                //提交表单
                $('.item-submit').click(function () {

                    var username = $("#username").val();
                    var password = $("#password").val();
                    if(username=="")
                    {
                        layer.confirm('用户名不可为空！'
                            , {title: '友情提示'}
                            , function (index) {
                                layer.close(index);
                            },function ()
                            {
                                layer.close();
                            });
                    }
                    else if(password == "")
                    {
                        layer.confirm('密码不可为空！'
                            , {title: '友情提示'}
                            , function (index) {
                                layer.close(index);
                            },function ()
                            {
                                layer.close();
                            });
                    }
                    else{
                        $.ajax({
                            type: "post",
                            url: "/user/add/",
                            dataType: "json",
                            data:{
                                username:$("#username").val(),
                                password:$("#password").val(),
                                mobile:$("#phone").val(),
                                email:$("#email").val(),
                                qq:$("#QQ").val(),
                                nickname:$("#nickname").val()
                            },
                            success: function (res) {
                                if(res.status==200){
                                    window.location.href="/admin/index.html?param=user_list"
                                }
                                alert("提交成功，");
                            }
                        });
                    }

                })

        </script>

    </div>
    <!-- 内容区域 end -->

</div>

<script src="Scripts/layer.js"></script>
<script src="Scripts/jquery.form.min.js"></script>
<script src="Scripts/amazeui.min.js"></script>
<script src="Scripts/webuploader.html5only.js"></script>
<script src="Scripts/art-template.js"></script>
<script src="Scripts/app.js"></script>
<script src="Scripts/file.library.js"></script>



</body></html>